package com.qipay;

import com.qi.qipay.commons.service.ServiceContainer;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;

public class ContextLoadedListener implements ApplicationListener<ContextRefreshedEvent> {

    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        if (null == event.getApplicationContext().getParent()) {
            ServiceContainer.init(ContextHolder.getApplicationContext());
        }
    }
}
